package org.quadraspace.model;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlTransient;


@Entity
public class Data {

	@Id
	@GeneratedValue
	private Long theId;
	
	@XmlTransient
	public Long getTheId() {
		return theId;
	}
	public void setTheId(Long theId) {
		this.theId = theId;
	}
	private String quantity;
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	private Set<Channel> channels = new HashSet<Channel>();
	@XmlAttribute
	public String getQuantity() {
		return quantity;
	}

	public void setQuantity(String quantity) {
		this.quantity = quantity;
	}
	
	@XmlElementWrapper(name= "channels")
	@XmlElement(name = "channel")
	public Set<Channel> getChannels() {
		return channels;
	}
	
	public void setChannels(Set<Channel> channels) {
		this.channels = channels;
	}
}

